import { Component } from 'react'
import {View, Text } from '@tarojs/components'
import {AtRate} from 'taro-ui'
import "taro-ui/dist/style/components/rate.scss"
import "taro-ui/dist/style/components/icon.scss"
import './index.scss'

export default class LgRate extends Component {
  state = {
      value:this.props.value||0
  }

  componentDidMount () {}

  componentDidShow () {}

  componentDidHide () {}

  componentDidCatchError () {}
  handleChange (value) {
    this.setState({
      value
    })
  }
  getValue(){return this.state.value}
  render () {
    var props = this.props; 
    var className = props.className || "";
    return (
        <View className={""} style={props.style || {}}>
           <AtRate size='15'  value={this.state.value} onChange={this.handleChange.bind(this)} />
           <Text className="rate_grade">{(this.state.value).toFixed(1)}分</Text>
        </View>
    )
  }
}